include mixin
ul.breadcrumb
	li
		a(href='/portal/index') 首页
	li.sep >
	li
		a(href='#/info') 我的广发
	li.sep >
	li 我的订单

.yui3-g
	include ../include/infoside
				
	.yui3-u-3-4
		section.list.border-arc(ng-show="type=='revoke'")
			h2.cd.padleft20.highLightTitle
				span 撤单操作
			.btop.pad30
				.op(ng-hide='orderItem.success')
					p.mbottom20
						span.bc.b.font14 产品名称：
						| {{orderItem.title}}
					p.mbottom20
						span.bc.b.font14 产品代码：
						| {{orderItem.code}}
					p.mbottom20(ng-show='orderItem.balance')
						span.bc.b.font14 总金额(元)：
						| {{orderItem.balance}}
					p.mbottom20(ng-show='orderItem.share')
						span.bc.b.font14 赎回/转换份额(份)：
						| {{orderItem.share}}
					p.mbottom20
						span.bc.b.font14 下单时间：
						| {{orderItem.order_date | datehyphen}}&nbsp;{{orderItem.order_time | timehyphen}}
					p.mbottom20(ng-hide="orderItem.payment_method == 'direct_pay'") 
						span.bc.b.font14.vat 交易密码：
						span(gf-sec-pwd='tradePwd', width=130, height=23)
					p.mbottom20(ng-show="orderItem.payment_method == 'direct_pay'")
						span.bc.b.font14.vat 理财密码：
						input(type="password", width=130, height=23, name='assetpwd', ng-model='assetpwd')
					p.rc(ng-show='orderItem.error', ng-bind='orderItem.error')
					p.mbottom20 
						a.btn.primary(href='javascript:;', ng-click="chedan(orderItem, orderItem.payment_method == 'direct_pay');") 确认
						a.btn.primary.mleft20(ng-click="goBack();", href='javascript:;') 返回
				.result(ng-show='orderItem.success')
					.regsuccessleft.success 恭喜！您已成功完成撤单。
					.pad10
					a.regsuccessleft.btn.primary(href='javascript:;', ng-click='goBack();') 确定
					a.mleft15.btn.primary.disabled(href='javascript:;', ng-click='goBack();') 返回

		section.list.border-arc(style='_position:relative;', ng-show="type!='revoke'")
			h2.cd.padleft20.highLightTitle(ng-switch='viewMode')
				span(ng-switch-when='order') 我的订单
				span(ng-switch-when='!!detail') 订单编号：{{orders.items[detailIndex].order_id|uppercase}}
			.btop(ng-switch='loading')
				.pad30.mtop20(ng-switch-when='true') Loading&#8230;
				.myOrderList(ng-switch-default)
					div(ng-show='viewMode =="order"')
						.filters
							| 订单状态：
							select.mright15(ng-model='$parent.selection', ng-change='changeState(selection)', ng-options='status[0] as status[1] for status in orderstatusArray')
							| 开始时间：
							input.mright15(gf-calendar, readonly, ng-model='$parent.begin_date', ng-change='getData({pageNum: 1});', style='width: 68px;')
							| 结束时间：
							input.mright15(gf-calendar, readonly, ng-model='$parent.end_date', ng-change='getData({pageNum: 1});', style='width: 68px;')
							.ib.searchContainer
								form(ng-submit='search(q)')
									span 关键字：
									.searchCtrl.border-arc
										button.search(type='submit', ng-click='search(q)')
										input(type='search', ng-model='q', name='q', placeholder='请输入产品名称或产品代码')
						.orders
							table
								thead
									tr
										th.first(style='width:90px;display:none') 订单编号
										th 产品名称
										th(style='width:80px;*width:110px;') 购买金额(元)
										th.padleft0.padright0 转入产品名称
										th.padleft0.padright0
											| 赎回/转换份额
											br
											| (份)
										th(style='width:70px;*width:100px;') 下单时间
										th(style='width:60px;*width:80px;') 订单状态
										th(style='width:60px;*width:80px;') 结算方式
										th.last(style='width:60px;*width:90px;') 操作
								tbody(ng-init="product_type={money: 'asset'}")
									tr(ng-repeat='item in orders.items', ng-class-even="'even'")
										td.first(ng-bind='item.order_id',style='display:none')
										td.padleft0.padright0
											a.link(gf-href="#/{{product_type[item.product_type] || item.product_type}}/detail?pid={{item.id}}", ng-bind='item.title')
										td.rc(ng-bind="item.balance")
										td.padleft0.padright0(ng-bind="item.trans_title || '--'")
										td(ng-bind="item.share || '--'")
										td
											span(ng-bind='item.order_date | datehyphen')
											br
											span(ng-bind='item.order_time | timehyphen')
										td(ng-bind='orderstatus[item.overall_status]')
										td
											span(ng-show="item.payment_method == 'earnest'")
												em.icn_earnest(title="保证金支付")
											span(ng-show="item.payment_method == 'direct_pay'")
												em.icn_card_pay(title="银行卡支付")
										td.last.padleft0.padright0(ng-switch='item.overall_status')
											span(ng-switch-when='3')
												span(ng-show="item.payment_method != 'direct_pay' || item.type == 'change' || item.type =='redeption'")
													a.link(href='javascript:;', ng-click="chedanbefore(item, 'revoke', 1);") 撤单
													span.rline	| &nbsp;
												a.link(href='javascript:;', ng-click="detail($index);") 查看
											span(ng-switch-when='0')
												a.link(href='javascript:;', ng-click='retry(item.order_id, item.payment_method)') 支付
												span.rline	| &nbsp;
												a.link(href='javascript:;', ng-click="detail($index);") 查看
											span(ng-switch-when='1')
												a.link(href='javascript:;', ng-click="detail($index);") 查看
											span(ng-switch-when='-1')
												a.link(href='javascript:;', ng-click='retry(item.order_id, item.payment_method)') 支付
												span.rline	| &nbsp;
												a.link(href='javascript:;', ng-click="detail($index);") 查看
											span(ng-switch-when='2')
												a.link(href='javascript:;', ng-click="detail($index);") 查看
											span(ng-switch-when='-2')
												a.link(href='javascript:;', ng-click="detail($index);") 查看
											span(ng-switch-when='-3')
												a.link(href='javascript:;', ng-click="detail($index);") 查看
						mixin pager
						.mbottom10.mleft20(ng-show='orders.items.length')
							| 共&nbsp;
							span.rc.font13 {{orders.count}}
							| &nbsp;条数据
					
					div.vmuDetail(ng-show='viewMode == "detail"')
						.orderDetail(ng-repeat='item in orders.items', ng-show='$index == detailIndex')
							.infoTitle 订单信息
							table.infoTable
								thead
									tr
										th.rowf.row1 订单编号
										th.rowf.row2 订单类型
										th.rowf.row3 订单状态
										th.rowf.row4	订单提交时间
										th.rowf.row5 操作失败原因
								tbody
									
									tr
										td.rowd.row1(ng-bind='orders.items[detailIndex].order_id|uppercase')
										td.rowd.row2(ng-bind='orderType[item.type]')
										td.rowd.row3.rc(ng-bind='orderstatus[item.overall_status]')
										td.rowd.row4
											span(ng-bind='item.order_date | datehyphen')
											br
											span(ng-bind='item.order_time | timehyphen')
										td.rowd.row5
											span(ng-bind='+item.order_result || "--"')
											span(ng-show="item.order_result && (item.order_result.indexOf('不足') > -1 || item.order_result.indexOf('不够') > -1)")
												| ，您的保证金账户余额为
												span(style='word-wrap: break-word;word-break: break-all;', ng-bind='balance.fund')
												| 元，小于您的购买金额，
												a.link(href='#', onclick='return false;', ng-click='transfer_accounts(1);') 我要转账
									
							.infoTitle 产品信息
							table.infoTable
								thead
									tr
										th.rowf.row1 产品名称
										th.rowf.row2 产品代码
										th.rowf.row3(ng-show='item.type == "purchase" || item.type == "other" || item.type == "purchase"') 购买金额(元)
										th.rowf.row4(ng-show='item.type == "purchase" || item.type == "other" || item.type == "purchase"') 购买份额(份)
										th.rowf.row3(ng-show='item.type == "redeption"') 赎回金额(元)
										th.rowf.row4(ng-show='item.type == "redeption"') 赎回份额(份)
										th.rowf.row3(ng-show='item.type == "change"') 转换金额(元)
										th.rowf.row4(ng-show='item.type == "change"') 转换份额(份)
								tbody
									tr
										td.rowd.row1(ng-bind='item.title')
										td.rowd.row2(ng-bind='item.code')
										td.rowd.row3(ng-bind='item.balance || "--"')
										td.rowd.row4(ng-bind='item.deal_share || "--"')
								tbody(style='display:none')
									tr(style='border-bottom:1px dashed #a0a0a0;')
										td.infoKey 产品名称：
										td(ng-bind='item.title')
										td.infoKey(style='width:120px;') 产品代码：
										td(ng-bind='item.code')
										td.infoKey 购买金额（元）：
										td(ng-bind='item.balance') &nbsp;
									tr
										td.infoKey 转入产品代码：
										td(ng-bind='item.trans_code')
										td.infoKey 赎回/转换份额(份)：
										td(ng-bind='item.deal_share')
							a.btn.primary.goBack.mtop20(style='float:none;margin-left:280px;width:100px',href='javascript:;', ng-click='goBack()') 返回
							//- a.btn.primary.mtop20(href='javascript:;', ng-show='item.state != 1 && item.state != 2', ng-click='retry(item._id)') 支付
			.dialog.border(ng-show='retryTip', style='width:400px;left:50%;margin-left:-200px;height:auto;position:fixed;top:200px;_position:absolute;')
				.close(ng-click='retryTip = ""') &nbsp;
				.title.font16 出错提示
				.pad15
					{{retryTip}}


.hidden(ng-show='dialog.transfer_accounts.opened', gf-remove-class='hidden', defer=400, ng-init="dialog.transfer_accounts={};")
	.gf-mask
	div(ng-switch='dialog.transfer_accounts.opened')
		.dialog3.border.gf-dialog(fixed=1, style='height: 360px;', ng-switch-when='1')
			.dialog-close(title='关闭', ng-click='dialog.transfer_accounts={}') &nbsp;
			.dialog-title.font18.padleft15 转账
			.transfer_accounts(ng-hide='dialog.transfer_accounts.result')
				div
					.label.nfc 转账方向：
					a.none.radio(ng-class='{checked: dialog.transfer_accounts.transfer_direction=="1"}', ng-click='dialog.transfer_accounts.transfer_direction="1"', href='#', onclick='return false;', hidefocus) 银行转证券
					span.padleft20
					a.none.radio(ng-class='{checked: dialog.transfer_accounts.transfer_direction=="2"}', ng-click='dialog.transfer_accounts.transfer_direction="2"', href='#', onclick='return false;', hidefocus) 证券转银行

				div
					.label.nfc 选择银行：
					a.none.radio(ng-click='dialog.transfer_accounts.bank_no=bank_list.bank_no', ng-class="{checked: dialog.transfer_accounts.bank_no==bank_list.bank_no}", href='#', onclick='return false;', hidefocus) {{bank_list.bank_name}}

				div
					.label.nfc 选择币种：
					a.none.radio(ng-class='{checked: dialog.transfer_accounts.money_type=="0"}', ng-click='dialog.transfer_accounts.money_type="0"', href='#', onclick='return false;', hidefocus) 人民币
					span.padleft20
					a.none.radio(ng-class='{checked: dialog.transfer_accounts.money_type=="1"}', ng-click='dialog.transfer_accounts.money_type="1"', href='#', onclick='return false;', hidefocus) 美元
					span.padleft20
					a.none.radio(ng-class='{checked: dialog.transfer_accounts.money_type=="2"}', ng-click='dialog.transfer_accounts.money_type="2"', href='#', onclick='return false;', hidefocus) 港元

				div(ng-show='dialog.transfer_accounts.transfer_direction=="1"')
					.label.nfc 银行密码：
					input.input(type='password', ng-model='dialog.transfer_accounts.bank_password', style='width: 80px;')
					span.pad5
					span(ng-switch='!!dialog.transfer_accounts.q_loading')
						span(ng-switch-when='true')
							img.mright8(src='img/loading.gif', width='20', height='20')
							| 正在查询,请稍候...
						span(ng-switch-when='false', ng-switch='!!dialog.transfer_accounts._occur_balance || 0 == dialog.transfer_accounts._occur_balance')
							a.link(href='#', onclick='return false;', ng-switch-when='false', ng-click='query_bank_balance();') 查询余额
							span(ng-switch-when='true') 银行余额：
								span.oc2{{dialog.transfer_accounts._occur_balance}}元
					


				div(ng-show='dialog.transfer_accounts.transfer_direction=="2"')
					.label.nfc 资金密码：
					input.input(type='password', ng-model='dialog.transfer_accounts.fund_password')

				div
					.label.nfc 转账金额：
					input.input(ng-model='dialog.transfer_accounts.occur_balance', maxlength=15)

				.padtop15
					.label.tar
						img.mright8(src='img/loading.gif', ng-show='dialog.transfer_accounts.t_loading')
					a.dialog-btnok.ib.tac(href='javascript:void(0);', hidefocus, ng-click='transfer_accounts();') 提&nbsp;交
					a.dialog-btncancel.ib.tac.mleft15(href='javascript:void(0);', hidefocus, ng-click='dialog.transfer_accounts={}') 返&nbsp;回

		.dialog3.border.gf-dialog(fixed=1, style='height: 260px;', ng-switch-when='2')
			.dialog-close(title='关闭', ng-click='dialog.transfer_accounts={}') &nbsp;
			.dialog-title.font18.padleft15 提示
			.container.nfc
				.padbottom10
					.ib.vam.dialog-success
					.ib.vam.font24.padleft15 恭喜你！
				.container-content.font18(ng-switch='dialog.transfer_accounts.transfer_direction')
					span(ng-switch-when='1') 银行转证券账户转账成功。
					span(ng-switch-when='2') 证券转银行账户转账成功。
				.padtop30
					a.dialog-btnok.ib.tac(ng-show='step==1', href='javascript:void(0);', hidefocus, ng-click='dialog.transfer_accounts={};') 确&nbsp;定
					a.dialog-btnok.ib.tac(ng-show='step==3', href='javascript:void(0);', hidefocus, ng-click='repurchase();') 重新购买
					a.dialog-btncancel.ib.tac.mleft15(href='javascript:void(0);', hidefocus, ng-click='dialog.transfer_accounts.opened=1') 返&nbsp;回

		.dialog3.gf-dialog(fixed=1, style='height: 305px;', ng-switch-when='3')
			.dialog-close(title='关闭', ng-click="dialog.transfer_accounts={};") &nbsp;
			.dialog-title.font18.padleft15 提示
			.container.nfc
				.padbottom10
					.ib.vam.dialog-warning
					.ib.vam.font24.padleft15 很抱歉！
				.container-content.font18.padbottom8(ng-switch='dialog.transfer_accounts.transfer_direction')
					span(ng-switch-when='1') 银行转证券账户转账失败。
					span(ng-switch-when='2') 证券转银行账户转账失败。
				.btopdotted.padtop10
					| 失败原因：
					.sfc {{dialog.transfer_accounts.error}}

				.padtop15
					a.dialog-btnok.ib.tac(href='javascript:void(0);', hidefocus, ng-click='dialog.transfer_accounts={}') 确&nbsp;定
					a.dialog-btncancel.ib.tac.mleft15(href='javascript:void(0);', hidefocus, ng-click='dialog.transfer_accounts.opened=1') 返&nbsp;回

		.dialog3.gf-dialog(fixed=1, style='height: 305px;', ng-switch-when='4')
			.dialog-close(title='关闭', ng-click="dialog.transfer_accounts={};") &nbsp;
			.dialog-title.font18.padleft15 提示
			.container.nfc
				.padbottom10
					.ib.vam.dialog-warning
					.ib.vam.font24.padleft15 很抱歉！
				.container-content.font18.padbottom8 您的操作没有成功。
				.btopdotted.padtop10
					| 失败原因：
					.sfc {{dialog.transfer_accounts.error}}

				.padtop15
					a.dialog-btnok.ib.tac(href='javascript:void(0);', hidefocus, ng-click='dialog.transfer_accounts={}') 确&nbsp;定
					a.dialog-btncancel.ib.tac.mleft15(href='javascript:void(0);', hidefocus, ng-click='dialog.transfer_accounts.opened=1') 返&nbsp;回